import type { MetaclassType } from "@/constants/MetaclassType";
import type { StType } from "@/constants/StType";
import type { ModelOperation } from "@/modules/model/config/ModelOperation";
import type { ModelData } from "@/constants/types";
import type { DiagramMapDirection } from "../../graphTabs/diagramMap/DiagramMapEditor";
import type { PropertyItemType, LegendItemType, RefineLegendItemType } from "@/constants/constants";
import type { CommentItem } from "@/modules/cowork/service/dto";
import type {
  BannerPosition,
  LinkType,
  MetaElementItemType,
  ModelShareErrorType,
  NumberStatus,
  PropertyDataType,
  RelationCriteriaType,
  RelationOperationType,
  RelationType,
  SimpleDirection
} from "@/constants/Enums";
import type { ExpressionBaseDto } from "@/modules/model/service/dto";

export type ModelValue = ModelData;
export type StateSelectElementItems = {
  icon: string;
  instanceId: string;
  name: string;
  checked?: boolean;
};
export type CreateStateInvariantIsPopupData = {
  createStateParentId: string;
  popup: boolean;
  selectElementItems: StateSelectElementItems[];
};
export type CreateMessageIsPopupData = {};

export type SelectedRelation = {
  label: string;
  constrainType: number;
  appliedStereotypes: string[];
};

export type CheckableModelValue = ModelValue & { checked: boolean };

export type PropertyDropdownOption = {
  label: string;
  value: string;
  icon?: string;
  option?: any;
  enLabel?: string;
  appliedStereotypes?: string[];
};

export type AddModelItem = {
  enLabel: string;
  icon: string;
  label: string;
  metaClass: string;
  operation?: string;
  applyStereotypes: string[];
};

export type ValueSpecification = {
  metaclass: MetaclassType;
  value: any;
  elementId: string;
  element: ModelValue;
  extraValue?: string;
  terms?: string[];
};
export type PropertyRow = {
  id_?: string;
  addMethod?: string;
  dataType: PropertyDataType;
  deleteMethod?: string;
  enName: string;
  enTips: string;
  isMultiplicity: boolean;
  key: string;
  name: string;
  readonly: boolean;
  tips: string;
  updateMethod?: string;
  value: string | number | boolean | null | string[] | number[] | ModelValue | ModelValue[] | boolean[];
  items: PropertyDropdownOption[];
  addModelItems?: AddModelItem[];
  priorityCommentLevel?: number; // 批注优先级
  commentList?: CommentItem[]; // 批注列表
  isNumberProperty?: boolean;

  /**
   * 属性所在的模型的id
   */
  modelId: string;
  modelIds?: string[];
  checkMethod?: string;
  moreBtnCondition?: string;
  // updateValueSpecification?: UpdateValueSpecificationDto

  displayLevel: number;
  valueSpecificationInfo?: ValueSpecification;
  extraInfo?: any; // 存储表格需要的一些额外数据
  slotId?: string;
  propertyId?: string;
  values?: any[];
  id?: string;
  nullable?: boolean;
  parentId?: string;
  unit?: string;
  specificComponent?: string; // 该属性渲染 需要的特定组件

  displayName?: string;
  upper?: string;
  terms?: string[];
  itemType?: PropertyItemType;
  consistent?: boolean;

  columnId?: string;
  instanceId?: string;

  // 特殊业务逻辑注入的额外数据
  extraData?: {
    transitionId?: string; // 编辑事件类型
  };
};

export type PropertyRowGroup = {
  expand: boolean;
  model?: ModelData;
  key: string;
  name: string;
  properties: PropertyRow[];
  instanceId?: string;
  // extraProps: PropertyRow[]
};

export type TablePropertyRow = {
  rowId: string;
  cells: PropertyRow[];
  model: ModelData;
  adornment?: string; // 行样式
  priority?: number; // 样式优先级
};

export type TableALLProperty = {
  normalProperties: PropertyRow[];
  customizeProperties: PropertyRow[];
  otherProperties: PropertyRow[];
};

export type SlotValue = {
  id: string;
  value: string | number | boolean | null;
  model?: ModelData;
  icon?: string;
  name?: string;
  unit?: string;
  showUnitOnValues?: boolean;
};
export type InstanceSlotData = {
  dataType: PropertyDataType;
  hidden: boolean;
  icon: string;
  items: any[];
  moreBtnCondition: string;
  name: string;
  propertyId: string;
  slotId?: string;
  values: SlotValue[];
  isMultiplicity?: boolean;
  nullable?: boolean;
  readonly?: boolean;
  id_?: number;
};
export type ClassifierData = ModelData & {
  isExpand: boolean;
  slots: InstanceSlotData[];
};

export type CreateSpecification = {
  projectId: string;
  propertyId: string;
  parentId?: string;
  value?: string | string[] | boolean;
  slotId?: string;
  valueSpecificationId?: string;
  isSelected?: boolean;
  dataType?: string;
  id?: string;
  key?: string;
};
export type SLotDataValuese = {
  value: string;
  icon?: string;
  name?: string;
  isSelected?: boolean;
  id?: string;
};
export interface ConstraintData {
  constraintId: string;
  constraintName: string;
  specificationId: string;
  metaClass: MetaclassType;
  valueSpecificationInfo: {
    elementId: string;
    extraValue: string;
    metaclass: MetaclassType;
    value: string;
    element: ModelValue;
  };
  valueSpecificationRow: PropertyRow;
  isSelected: boolean;
  nameForEdit: string;
  modelId: string;
}

export interface LegendItem {
  instanceId: string;
  /** 图例名称 */
  name?: PropertyRow;
  /** 样式 */
  adornment?: PropertyRow;
  /** 指定元素 */
  elements?: PropertyRow;
  /** 指定条件 */
  condition?: PropertyRow;
  /** 优先级 */
  priority?: PropertyRow;
}

/**
 * 包含图例项列表的图例列表
 */
export type LegendData = {
  /** 图例模型id */
  instanceId: string;
  /** 图例名称 */
  name: string;
  /** 图例项数据列表 */
  items: {
    /** 图例项id */
    instanceId: string;
    /** 图例名称 */
    name?: string;
    /** 样式 */
    adornment?: string;
    /** 指定元素 */
    elements?: string;
    /** 指定条件 */
    condition?: string;
    /** 优先级 */
    priority?: number;
  }[];
};

export type UpdateSpecification = {
  projectId: string;
  propertyId: string;
  parentId?: string;
  value?: string | boolean;
  slotId?: string;
  valueSpecificationId?: string;
};
export type DeleteSlotSpecificationDto = {
  projectId: string;
  specificationId: string;
  slotId: string;
};
export type LoadSlotInstance = {
  projectId: string;
  modelId: string;
  classifierId: string;
  parentId?: string;
  stereotypeId?: string;
  propertyId?: string;
  id?: string;
};
export type SlotDataShow = {
  name: string;
  propertyId: string;
  slotId: string;
  valueAdd: boolean;
  values: UpdateSlotValue[];
};

export type UpdateSlotValue = {
  name: string;
  icon: string;
  slotId: string;
  metaclass: string;
  value: string | number | boolean | null;
};

export type UpdateAppliedStereotypeBatchDto = {
  value: any; // 如果是关联输入，此处为属性值的模型id
  instanceId: string;
};

export type UpdateModelPropertyDto = {
  projectId: string;

  key: string;

  value: any; // 如果是关联输入，此处为属性值的模型id

  dataType?: PropertyDataType;

  instanceId: string;
  instanceIds?: string[];
  isMultiplicity?: boolean;

  updateMethod?: string;
  updateValueSpecification?: UpdateValueSpecificationDto;
};
export type UpdateEventTypeWhenNoTriggerDto = {
  projectId: string;

  key: string;

  value: string[]; // 如果是关联输入，此处为属性值的模型id

  dataType?: PropertyDataType;

  isMultiplicity?: boolean;

  updateMethod?: string;

  transitionId: string;
};

// 关联输入更新内容
export type UpdateValueSpecificationDto = {
  // 根据类型创建值模型
  projectId: string;
  metaclass?: string; // metaclass
  value?: string | number | boolean | null | boolean[];
  instanceId: string;
  extraValue: any;
  valueSpecificationId?: string;
  key: string;
};
export type ModelIdDto = {
  // 根据类型创建值模型
  projectId: string;
  modelId: string;
  name: string;
  constrainType: number;
  appliedStereotypes?: string[];
};

export type AddPropertyValueDto = {
  projectId: string;

  key: string; // 当前模型的属性key

  metaclass: any; // 添加的值的模型类型

  dataType: PropertyDataType; // 添加的值的数据类型

  instanceId: string; // 当前模型/实例ID
  instanceIds?: string[];
  addMethod?: string; // 追加模型方法名

  isFromStereotype?: boolean; // 是否来自stereotype拓展

  applyStereotypes?: string[]; // 应用构造型
};
export type AppendPropertyValueDto = {
  projectId: string;

  instanceId: string;

  appendMethod?: string;

  key: string;

  dataType: PropertyDataType;

  value: any;
};
export type RemoveConveyedDto = {
  projectId: string;
  removeInstanceId: string;
  relationId: string; // 关系模型id，如连接器，活动边
  instanceId: string;
};
export type DeletePropertyDto = {
  projectId: string;
  deleteInstanceId: string;
  deleteMethod: string;
  instanceId: string;
  instanceIds?: string[];
  key: string;
  index?: number | null;
};
export type PropertyList = {
  id: string;
  name: string;
  icon: string;
  moreBtnCondition: string;
};
export type PropertyGroupInfoDto = {
  projectId: string;
  instanceId: string;
  propertyGroupId: string;
  rowIds: string;
};
export type GetOptionsDto = {
  checkMethod: string;
  instanceId: string;
  instanceIds?: string[];
  key: string;
  moreBtnCondition: string;
  projectId: string;
};

export type GetSelectOptionsByPageDto = {
  checkMethod: string;
  instanceId: string;
  key: string;
  moreBtnCondition: string;
  projectId: string;
  page: number;
  size: number;
  keyword: string;
};

export type RemovePreoperty = {
  deleteInstanceId: string;
  deleteMethod: string;
  instanceId: string;
  key: string;
  projectId: string;
};
export type OptionsReponse = {
  code: number;
  data: { icon: string; instanceId: string; name: string }[];
  message: string;
  title: string;
};
export type NodeCreateRelation = {
  sourceId: string;
  targetId: string;
  metaclass: MetaclassType;
  stereotype: StType[];
  projectId: string;
  value: string;
};
export interface CreateRelationDto {
  projectId: string;
  parentId: string;
  metaclass: string;
  applyStereotypes?: string[];
  source: string;
  target: string;
  type: number; // 1关系
  operation?: ModelOperation;
}

export interface CreateRelationBatchDto {
  projectId: string;
  metaclass: string;
  applyStereotypes?: string[];
  relationshipInfos: Array<{
    parentId: string;
    sourceId: string;
    targetId: string;
  }>;
  type: number; // 1关系
  operation?: ModelOperation;
}

export type UpdateModelRequirementIdsDto = {
  projectId: string;
  ids: { [p: string]: string };
  prefixs: { [p: string]: string };
  parents: { [p: string]: string };
};
export interface RequirementActionDto {
  shapeDepth: number;
  expand: boolean;
  projectId: string;
  modelId: string;
  shapeId: string;
  diagramId: string;
  type: StType;
  applyStereotypes: StType[];
  ownerId: string;
  diagramMapDirection: DiagramMapDirection;
}

export interface CapabilityActionDto extends RequirementActionDto {
  targetType: StType;
  metaclass?: string;
  targetInstanceId?: string;
}

export type AddEntryExitPointDto = {
  projectId: string;
  modelId: string;
  pseudoStatePointIds: string[];
};

export interface ImportExcelToTableDto {
  projectId: string;
  modelId: string;
  modelBaseSt: string;
  excelData: {}[];
}

export interface ExportFileDto {
  projectId: string;
  modelId: string;
  filePath: string;
  isModelLibrary?: boolean;
}

export interface ExportMd3Dto extends ExportFileDto {
  profileVersion: number;
}
export interface ExportXmiDto {
  isStandard?: boolean;
  md3FileURL: string;
  outFileURL: string;
  projectId: string;
  instanceIds?: string[];
  isExportAssociation?: boolean;
}

export interface WarningModelInfo {
  propertyKey: string;
  value: string;
}
export interface ValidationResponseAnnoation {
  warningId?: string;
  abbreviation: string;
  errorMessage: string;
  instanceId: string;
  shapeId?: string;
  severity: string;
  ignore?: boolean;
  errorType?: ModelShareErrorType;
  warningModelInfo?: WarningModelInfo;
  ruleKey?: string;
  extraMessage?: string; // 补充的错误信息（用于翻译）
  extraData?: { shapeModelName: string; diagramShapeModelName: string }; // 补充的错误信息中的自定义数据
  ruleType?: number;
}

export interface WarningModelInfo {
  propertyKey: string;
  value: string;
}
export interface ValidationResponseAnnoation {
  warningId?: string;
  abbreviation: string;
  errorMessage: string;
  instanceId: string;
  shapeId?: string;
  severity: string;
  ignore?: boolean;
  errorType?: ModelShareErrorType;
  warningModelInfo?: WarningModelInfo;
}
export interface ValidationResponse {
  annoations: ValidationResponseAnnoation[];
  namespace: string;
  instanceId: string;
  ownerId?: string;
  model: ModelData;
  namespaceModel?: ModelData;
  validateTime?: string;
}
export interface ProjectUsageInfo {
  usageProjectId: string;
  usageProjectName: string;
  usageProjectPath: string;
  versionId: number;
}
export type PropertyGroupInfo = {
  description: string;
  groupId: string;
  name: string;
};
export type LineStyle = {
  color: string;
  strokeDasharray: string;
};

export type MetaElementListItem = {
  icon: string;
  metaClassId: string;
  label?: string;
  type: MetaElementItemType; // metaclass 或者 stereotype
};
export type MetaElementItem = {
  metaClassId: string;
  propertyKey: string;
  propertyName: string;
  type: MetaElementItemType; // metaclass 或者 stereotype
};

export interface BaseNavigation {
  key: string; // 关系唯一标识
  label: string; // 关系名称
  enLabel?: string;
  operationType: RelationOperationType; // 操作类型，即节点类型
  argName?: string;
  operationName?: string;
  context?: any; // 上下文
  isDisplay?: any; // 是否显示
  style?: LineStyle; // 样式
}

export interface MetachainNavigation extends BaseNavigation {
  type: RelationType;
  chain: Array<MetaElementItem>;
}
export interface SimpleNavigationCollection extends BaseNavigation {
  simpleNavigations: SimpleNavigation[];
  resultFilterTypes?: ResultFilterType[];
}

export interface SimpleNavigation extends BaseNavigation {
  type: RelationType;
  direction: SimpleDirection; // 关系方向
}
export interface ImpliedRelationCriteria extends BaseNavigation {
  body: SimpleNavigation[];
}
export interface ImpliedNavigation extends BaseNavigation {
  direction: SimpleDirection; // 关系方向
  criteria: ImpliedRelationCriteria; // 追溯关系
  source: ImpliedRelationCriteria; // 源参数
  target: ImpliedRelationCriteria; // 目标参数
  includeDirect: boolean; // 是否包含直接关联
}

export interface PropertyGroupItem {
  metaclass?: MetaclassType;
  propertyName: string;
  propertyValue: string;
  propertyValues: string[];
  dataType: PropertyDataType;
  isMultiplicity: boolean;
}
export interface FindNavigation extends BaseNavigation {
  modelName: string;
  filterType: string;
  filterTypes: FilterTypes;
  propertyGroups?: PropertyGroupItem[];
  searchScope: string[]; // 关联关系、属性等
  isContainExtendPackage: boolean;
  isContainSubClass: boolean;
  isTypeAccurateMatch: boolean;
  isPropertyAccurateMatch: boolean;
}
export interface ValueNavigation extends BaseNavigation {
  valueType: string;
  value: string | number | boolean | undefined;
}
export interface TypeEvaluateNavigation extends BaseNavigation {
  filterTypes: { metaClasses: string[]; stereotypes: string[] };
  propertyGroups?: PropertyGroupItem[];
  isContainSubClass: boolean;
  isTypeAccurateMatch: boolean;
  input: any;
}
export interface PropertyEvaluateNavigation extends BaseNavigation {
  filterTypes: { metaClasses: string[]; stereotypes: string[] };
  propertyGroups?: PropertyGroupItem[];
  isContainSubClass: boolean;
  isTypeAccurateMatch: boolean;
  input: any;
}
export interface ExcludeNavigation extends BaseNavigation {
  from: any;
  exclude: any;
  resultFilterTypes: ResultFilterType[];
}
export interface FilterNavigation extends BaseNavigation {
  input: any;
  predicate: any;
}
export interface DefaultContextNavigation extends BaseNavigation {
  operationName: string;
}
export interface ValueUniqueOrderedNavigation extends BaseNavigation {
  resultFilterTypes: ResultFilterType[];
  type: any;
  direction: any;
  isValueOrdered: boolean;
  isValueUnique: boolean;
}
export interface TableScript extends BaseNavigation {
  scriptContent: string;
  scriptType: string;
  resultFilterTypes?: ResultFilterType[];
  mapOperationList?: MapOperation[];
}
export interface CountNavigation extends BaseNavigation {
  inputType?: string[];
  mapOperationList?: MapOperation[];
}
export interface UnionNavigation extends BaseNavigation {
  mapOperationList?: MapOperation[];
}
export interface ScriptArgs {
  argName: string;
  argType?: string;
  operationName?: string;
  impliedRelations?: ImpliedNavigation[];
  metachainNavigations?: MetachainNavigation[];
  simpleNavigations?: SimpleNavigation[];
  innerScript?: ScriptResult;
  id: string;
}

export interface MapOperation {
  operationType: RelationOperationType;
  key: string;
  style?: LineStyle; // 样式
  label?: string;
  enLabel?: string;
  argName: string;
  operationName?: string;
  scriptName?: string;
  scriptType?: string;
  scriptContent?: string;
  simpleNavigations?: SimpleNavigation[];
  mapOperationList?: MapOperation[];
  resultFilterTypes?: ResultFilterType[];
  [p: string]: any;
}

export interface ScriptResult {
  resultFilterTypes?: ResultFilterType[];
  scriptArgs: ScriptArgs[];
  scriptContent: string;
  scriptName: string;
  scriptType: string;
  argName?: string;
  id: string;
}
export interface FilterTypes {
  metaClasses: string[]; // 元类
  stereotypes: string[]; // 构造型
  basicTypes: string[]; // 基础类型
}
export interface FilterType {
  enName?: string;
  icon: string;
  name: string;
  value: string;
}
export interface ResultFilterType {
  enName?: string;
  icon: string;
  name: string;
  value: string;
}
export interface SimpleNavigationsSelect extends SimpleNavigation {
  isChecked: boolean;
}

export type QuerySelectedListSelect = {
  groupName: string;
  expand: boolean;
  simpleNavigations: SimpleNavigationsSelect[];
};

export type NumberPartInfo = {
  id: string;
  name: string;
  sequenceType: string;
  initialValue: string;
  instanceId?: string;
  status?: NumberStatus | null;
};

export type NumberPartOperationInfo = {
  instanceId: string;
  name: string;
  sequenceType: string;
  initialValue: string;
  status: string;
};

export type NumberSchemeDto = {
  projectId: string;
  parentId: string;
  numberPartOperationInfos: NumberPartOperationInfo[];
};

export type NumberPartRow = {
  initialValueConfig: PropertyRow;
  instanceId: string;
  nameConfig: PropertyRow;
  sequenceConfig: PropertyRow;
  status?: NumberStatus;
};

export type QueryMetaElementList = {
  icon: string;
  metaClassId: string; // 对应的 metaclass 或者 stereotype 的值
  type: "metaclass" | "stereotype"; // metaclass 或者 stereotype
};
export interface QueryRelationCriterion extends ExpressionBaseDto {
  mapId: string;
  projectId: string;
}

export interface QueryCustomColumnResponse extends ExpressionBaseDto {
  projectId: string;
  tableId: string;
  customizeColumnId: string;
  customizeColumnName: string;
  customizeColumnType: string;
}

export type Link = {
  id: string; // 链接uuid
  type: LinkType; //
  url: string; // 连接地址，可以是一个网址或本地文件地址。对于导航到模型元素的这里是模型id
  modelId?: string; // 链接的目标模型
};
export type HyperLinkInfo = {
  activeId?: string | null; // default / specification / uuid/ modelId
  idType?: HyperLinkIdType | null;
  links: Link[]; // 额外的link，不包含默认和属性设置
};
export type HyperLinkIdType = "default" | "ownedDiagramId" | "typedOwnedDiagramId" | "hypereLink";

export type GetModelTreeDto = {
  projectId: string;
  instanceId?: string;
  key?: string;
  dataType?: string;
  moreBtnCondition?: string;
  isMultiplicity?: boolean;
  checkMethod?: string;
  updateMethod?: string;
};

export type UpdateTableColumnPropertyDto = {
  projectId: string;
  modelId: String;
  value: {
    columnIds?: string[];
    hideColumns?: string[];
    columnkeys: string[];
    modelBaseSt: string;
  };
};

export interface CreateForecastTableDto {
  projectId: string;
  applyStereotypes: string[];
  metaclass: string;
  parentId?: string;
  defaultName?: string;
  defaultRows?: string[];
  defaultColumns?: string[];
}

export type GetAvailableElementsDto = {
  addWay: string;
  instanceId: string;
  addType: string;
  projectId: string;
  page: number;
  size: number;
  name: string;
};
export type OriginTextInfo = {
  modelId: string;
  originText: string;
};
export type NeedSplitTerm = {
  modelId: string;
  propertyKey: PropertyKey;
  originText: string | OriginTextInfo[];
};

export type TermInfo = {
  modelId: string;
  terms: string[];
};

export type DealTermRes = {
  modelId: string;
  propertyKey: string;
  terms: string[] | TermInfo[];
};

type LegendTarget = {
  /** 数据源id */
  id: string;
  /** */
  stereotypeId: string;
  /** 对应的模型id */
  modelId: string;
};

/** 返回的推荐图例模板数据格式 */
export interface LegendTemplateRes {
  id: string;
  /** 类型 */
  type: LegendItemType;
  /** 细分类型 */
  key: string;
  /** 图例名称 */
  name: string;
  /** 图例项列表 */
  children: {
    id: string;
    /** 选定样式 */
    adorment: string;
    /** 类型 */
    type: LegendItemType;
    /** 细分类型 */
    refineType: RefineLegendItemType;
    /** 记录父级唯一key */
    parentKey: string;
    /** 图例项原始数据 */
    originData: LegendTarget & { [key in string]: any };
    /** 图例项名称 */
    name: string;
    /** 表达式 */
    express: any;
  }[];
}

/** 表达式查询统一返回类型 */
export interface CommonQueryRelationCriterion extends ExpressionBaseDto {
  mapId?: string;
  projectId: string;
  instanceId: string;
  type: RelationOperationType;
  customizeColumnName?: string;
  customizeColumnId?: string;
  customizeColumnType?: string;
  resultFilterTypes?: ResultFilterType[];
  direction?: any;
}

export type CommonQueryRelationCriterionDto = {
  projectId: string;
  instanceId: string;
  type: RelationCriteriaType;
  columnId?: string;
};

export interface CommonUpdateRelationCriterionDto extends ExpressionBaseDto {
  projectId: string;
  instanceId: string;
  type: RelationCriteriaType;
  customizeColumnName?: string;
  customizeColumnId?: string;
  customizeColumnType?: string;
  resultFilterTypes?: ResultFilterType[];
  direction?: any;
}

export interface AffectModelListDto {
  projectId: string;
  instanceId: string;
}

export interface ModelReplaceDto {
  projectId: string;
  sourceInstanceId: string;
  targetInstanceId: string;
}

export interface ModelPatchCreatePatchFileDto {
  projectId: string;
  patchElementIds: string[];
  patchFileName: string;
  shapePath: string;
  modelPath: string;
}

export interface ModelPatchViewPatchDto {
  projectId: string;
  patchFilePath: string;
  instanceId?: string;
  applyWay?: string;
}

export interface ModelPatchViewPatchPropertiesDto {
  // projectId: string;
  instanceId: string;
}

interface InstanceProperty {
  icon: string;
  name: string;
  isUserCreate: boolean | null;
  instanceId: string;
}
export interface PropertyType {
  key: string;
  dataType: string;
  value: {};
  valueSpecificationInfo: {
    metaclass: string;
    elementId: string;
    value: {};
    extraValue: string;
  };
  cnName: string;
  instanceProperty: InstanceProperty[];
}

export type ProcessListItemType = {
  synonyms: string; // 命中近义词
  termInstanceId: string; // 命中术语
  termName: string; // 命中术语名称
  type: string; // 命中类型
  termHitModel: string; // 术语命中模型
  termHitAttribute: string; // 术语命中属性
  expectedHitAttributeName: string; // 预计命中术语名称
  termHitAttributeTypeId: string; // 术语命中属性类型模型id
  expectedHitAttributeTypeId: string; // 预计命中属性类型模型id
  readonly: boolean; // 是否只读

  reason?: string; // 失败原因
  termHitModelInfo?: {
    icon?: string;
    name?: string;
    id: string;
  };
};

export interface PostTermNormalizationTypeProcessDto {
  projectId: string;
  processListDTOS: ProcessListItemType[];
}

export interface PostTermNormalizationTypeProcessRequestData {
  successNum: number;
  processFailVos: ProcessListItemType[];
}

export interface GetTermListDto {
  projectId: string;
  ranges: string[];
  instanceIds: string[];
}

type NamingRulesDto = {
  nameRuleId: string;
  applyToElements: string[];
  isNameUni: boolean;
  prefixRule: string;
  defaultName: string;
  separator: string;
  prefix: string;
  dataType: "add" | "delete" | "update" | "";
};

export interface BatchUpdateNamingRuleDto {
  projectId: string;
  parentId: string;
  namingRules: NamingRulesDto[];
}

export interface BannerItem {
  html: string;
  status: BannerPosition;
  htmlSource: boolean;
  id?: string;
}
